#ifndef POSITION_H
#define POSITION_H


#include <cmath>

template <class T>
class Position
{


public:

	Position();
	Position(T x,T y);
	Position(const Position<T>& b);
	void set(T x, T y);
	void round();

	bool operator==(const Position<T>& b) const;
	Position<T>& operator=(const Position<T>& b);
    Position<T> operator+ (const Position<T>& b) const;
    Position<T> operator- (const Position<T>& b) const;
    Position<T> operator+ (T fScalar) const;
    Position<T> operator- (T fScalar) const;
    Position<T> operator* (T fScalar) const;
    Position<T> operator/ (T fScalar) const;
    Position<T> operator- () const;


	T length() const;

	void normalize() ;
	Position<T> normalizedCopy() const;
	T dot(const Position<T>& b) const;
	T cross(const Position<T>& b) const;


	T getAngle() const;
	T getAngleDif(T angle) const;

	bool inArea(const Position<T>& a, const Position<T>& b) const;
	void setToBounds(const Position<T>& a, const Position<T>& b);

	T x,y;

private:

	T SubtractAngles(T angle1, T angle2) const;
	T round(T a) const;





};

#include "Position.inl"

#endif